#include <chrono>
#include <iostream>

using namespace std::chrono;
using std::cout;
using std::endl;

class Timer{
    public:
        Timer() : m_begin(high_resolution_clock::now()){}
        void reset()
        {
            m_begin = high_resolution_clock::now();
        }

        int64_t elapsed() const
        {
            return duration_cast<milliseconds>
                (high_resolution_clock::now() - m_begin).count();
        }

        int64_t elapsed_seconds() const
        {
            return duration_cast<seconds>(high_resolution_clock::now() - m_begin).count();
        }
        int64_t elapsed_nano() const
        {
            return duration_cast<nanoseconds>(high_resolution_clock::now() - m_begin).count();
        }
        int64_t elapsed_micro() const
        {
            return duration_cast<microseconds>(high_resolution_clock::now() - m_begin).count();
        }

        int64_t elapsed_minutes() const
        {
            return duration_cast<minutes>(high_resolution_clock::now() - m_begin).count();
        }

        int64_t elapsed_hours() const
        {
            return duration_cast<hours>(high_resolution_clock::now() - m_begin).count();
        }
    private:
        time_point<high_resolution_clock> m_begin;
};

void fun()
{
    std::cout << "Hello Word " << std::endl;
}

int main()
{
    Timer t;
    fun();
    cout << "nano " <<  t.elapsed_nano() << endl;
    cout << "micro "<< t.elapsed_micro() << endl;
    cout << "ms "<< t.elapsed() << endl;
    cout << "seconds "<< t.elapsed_seconds() << endl;
    cout << "minutes "<< t.elapsed_minutes() << endl;
    cout << "hours "<< t.elapsed_hours() << endl;

    return 0;
}
